/**
 * Copyright (c) 2019-2029, wwww.kiwipeach.cn (liuburu@qq.com).
 * <p>
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License. You may obtain a copy of
 * the License at
 * <p>
 * https://www.apache.org/licenses/LICENSE-2.0
 * <p>
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License.
 */
package cn.kiwipeach.blog.service.demo;

import cn.kiwipeach.blog.exception.BlogException;
import cn.kiwipeach.blog.database.generator.domain.Blog;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springframework.transaction.annotation.Transactional;

/**
 * 博客 服务接口类
 *
 * @author kiwipeach
 * @since 1.0
 */
public interface IDemoService extends IService<Blog> {

    /**
     * 测试mybatis分页
     *
     * @param page   分页参数
     * @param userId 用户编号
     * @return 返回博客信息
     */
    IPage<Blog> queryBlogListDemo(IPage<Blog> page, String userId);

    /**
     * 事务测试服务
     *
     * @param blog 博客信息
     */
    @Transactional(rollbackFor = BlogException.class)
    void testTranactional(Blog blog);

    /**
     * 测试运行时异常
     */
    void testRuntimeException();


}
